<?php


namespace app\common\service;


use app\common\model\User;
use think\Model;

class ServiceBase extends Model
{

    // 重构函数
    public function __construct($data = [])
    {
        parent::__construct($data);
    }

    /**
     * 写入错误信息
     * @param int $code
     * @param string $msg
     */
    protected function setError($code=0, $msg='') {
        $this->error["code"] = $code;
        $this->error["msg"] = $msg;
    }
    /**
     * 获取错误信息
     * @param string $type
     */
    public function getError($type="msg") {
        return $this->error[$type];
    }
}